<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <title><%= title %></title>

  <!-- Bootstrap core CSS -->
  <link href="css/bootstrap.min.css" rel="stylesheet">

  <!-- Custom styles for this template -->
  <link href="css/starter-template.css" rel="stylesheet">

  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->

  <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
  <script src="js/bootstrap.min.js"></script>

  <!--CodeMirror-->
  <link href="css/codemirror.css" rel="stylesheet">
  <script src="js/codemirror.min.js"></script>
  <script src="js/sql.js"></script>
</head>
<body>
<form id="form1">

  <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="/">互动平台报表发布系统</a>
      </div>
      <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
          <li id="liReportList"><a href="/reports/">报表列表</a></li>
          <li id="liConfigList"><a href="/configs/">配置列表</a></li>
          <li id="liReportCreate"><a href="/configs/edit/0">新建</a></li>
        </ul>
      </div>
      <!--/.nav-collapse -->
    </div>
  </div>

  <div class="container">

    <div class="starter-template">
      <blockquote>
        <h5>概述</h5>
      </blockquote>
      <div>
        <ul>
          <li><a href="ReportList.aspx">报表列表</a></li>
        </ul>
      </div>
      <div>
        <blockquote>
          <h5>生成数据示例</h5>
        </blockquote>
        <textarea id="sqlDemo">
          --生成报表数据
          DECLARE @dStart DATETIME
          DECLARE @dEnd DATETIME
          SET @dStart = '2014-01-01' --请修改为真实的开始时间
          SET @dEnd = '2014-01-01'   --请修改为真实的结束时间

          WHILE @dStart < @dEnd
          BEGIN
          DELETE FROM report_rebuild_log_data
          WHERE tableName = '表名'
          AND CONVERT(VARCHAR(10),rebuildTime) = CONVERT(VARCHAR(10), @dStart)

          EXEC [dbo].[Proc_Report_Stat_Rebuild] '表名', '存储过程', @dStart
          SET @dStart = DATEADD(day, 1, @dStart);
          END
          GO

          --查询报表生成记录
          SELECT   *
          FROM     report_rebuild_log_data
          WHERE    tableName = '表名'
          ORDER BY logId DESC
        </textarea>
      </div>
    </div>

  </div>
  <!-- /.container -->
</form>
<script>
  window.onload = function () {
    var mime = 'text/x-plsql';
    window.editor = CodeMirror.fromTextArea(document.getElementById('sqlDemo'), {
      mode: mime,
      indentWithTabs: true,
      smartIndent: true,
      lineNumbers: true,
      matchBrackets: true,
      autofocus: false
    });
  }
</script>
</body>
</html>
